
#include "../libpatches.h"
#include "mult.h"
#include <stdio.h>

static void module_mult_processor(module m);

void module_mult_initializer(module m) {
	make_outputs(m, 1);
	m->output_names[0] = "out";
	m->customizer = customizer_count_inputs;
	m->processor = module_mult_processor;
}

static void module_mult_processor(module m) {
	output o = m->outputs[0];
	input * i = m->inputs;
	int count = m->input_count;

	*o = 1;

	/*
	fprintf(stderr, "processing multer\n");
	*/
	for (;count--; i++) 
		if (**i)
			*o *= ***i;
}
